package com.steed.rocketmq.consumer.consumer;

import com.aliyun.openservices.ons.api.Action;
import com.aliyun.openservices.ons.api.ConsumeContext;
import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.MessageListener;
import org.springframework.stereotype.Component;

/**
 * @author za-zhubin002
 * Created in 16:46 2017/10/31
 */
@Component
public class DemoConsumer implements MessageListener {
    @Override
    public Action consume(Message message, ConsumeContext consumeContext) {
        System.out.println("Receive: " + new String(message.getBody()));
        return Action.CommitMessage;
    }
}
